package edu.nf.controller.room;

import edu.nf.controller.BaseController;
import edu.nf.hotel.roomtype.RoomType;
import edu.nf.hotel.roomtypedao.RoomTypeDAO;
import edu.nf.hotel.roomtypedao.impl.RoomTypeDaoImpl;
import edu.nf.hotel.vo.ResultVO;
import org.nf.web.annotation.Model;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.annotation.RequestParam;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;

/**
 * @Data 2023-06-21
 * @Author Lsw
 */
public class UpdateRoomTypeController extends BaseController {
    @RequestMapping("/updateRoomType")
    public View updateRoomType(@Model RoomType roomType) {
        RoomTypeDAO roomTypeDAO = new RoomTypeDaoImpl();

       roomTypeDAO.update(roomType);

        ResultVO resultVO = success(roomTypeDAO);
        resultVO.setCode(200);
        resultVO.setMessage("修改成功");
        return new JsonView(resultVO);
    }
}
